<div class="refinancingPlans view">
<h2><?php  __('Refinancing Plan');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Refinancing Plan Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['refinancing_plan_id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Person'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $this->Html->link($refinancingPlan['Person']['surname'], array('controller' => 'people', 'action' => 'view', $refinancingPlan['Person']['person_id'])); ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Expenditure Type Source'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['expenditure_type_source']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Amount'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['amount']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Interest Balance'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['interest_balance']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Amount Balance'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['amount_balance']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Installment Quantity'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['installment_quantity']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['created']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created By'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['created_by']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Updated'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['updated']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Updated By'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $refinancingPlan['RefinancingPlan']['updated_by']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edit Refinancing Plan', true), array('action' => 'edit', $refinancingPlan['RefinancingPlan']['refinancing_plan_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Delete Refinancing Plan', true), array('action' => 'delete', $refinancingPlan['RefinancingPlan']['refinancing_plan_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $refinancingPlan['RefinancingPlan']['refinancing_plan_id'])); ?> </li>
		<li><?php echo $this->Html->link(__('List Refinancing Plans', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Refinancing Plan', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List People', true), array('controller' => 'people', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Person', true), array('controller' => 'people', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Expenses', true), array('controller' => 'expenses', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Expense', true), array('controller' => 'expenses', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('List Installments', true), array('controller' => 'installments', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('New Installment', true), array('controller' => 'installments', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Related Expenses');?></h3>
	<?php if (!empty($refinancingPlan['Expense'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Expense Id'); ?></th>
		<th><?php __('Property Id'); ?></th>
		<th><?php __('Expense Number'); ?></th>
		<th><?php __('Expenditure Type Source'); ?></th>
		<th><?php __('Amount'); ?></th>
		<th><?php __('Second Due Amount'); ?></th>
		<th><?php __('Interests'); ?></th>
		<th><?php __('Previous Debt'); ?></th>
		<th><?php __('Payment Date'); ?></th>
		<th><?php __('Payment Amount'); ?></th>
		<th><?php __('Invoice Number'); ?></th>
		<th><?php __('Refinancing Plan Id'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($refinancingPlan['Expense'] as $expense):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $expense['expense_id'];?></td>
			<td><?php echo $expense['property_id'];?></td>
			<td><?php echo $expense['expense_number'];?></td>
			<td><?php echo $expense['expenditure_type_source'];?></td>
			<td><?php echo $expense['amount'];?></td>
			<td><?php echo $expense['second_due_amount'];?></td>
			<td><?php echo $expense['interests'];?></td>
			<td><?php echo $expense['previous_debt'];?></td>
			<td><?php echo $expense['payment_date'];?></td>
			<td><?php echo $expense['payment_amount'];?></td>
			<td><?php echo $expense['invoice_number'];?></td>
			<td><?php echo $expense['refinancing_plan_id'];?></td>
			<td><?php echo $expense['created'];?></td>
			<td><?php echo $expense['created_by'];?></td>
			<td><?php echo $expense['updated'];?></td>
			<td><?php echo $expense['updated_by'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'expenses', 'action' => 'view', $expense['expense_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'expenses', 'action' => 'edit', $expense['expense_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'expenses', 'action' => 'delete', $expense['expense_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $expense['expense_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Expense', true), array('controller' => 'expenses', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Installments');?></h3>
	<?php if (!empty($refinancingPlan['Installment'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Installment Id'); ?></th>
		<th><?php __('Refinancing Plan Id'); ?></th>
		<th><?php __('Installment Number'); ?></th>
		<th><?php __('Amount'); ?></th>
		<th><?php __('Second Due Amount'); ?></th>
		<th><?php __('Interest'); ?></th>
		<th><?php __('Previous Debt'); ?></th>
		<th><?php __('Payment Date'); ?></th>
		<th><?php __('Payment Amount'); ?></th>
		<th><?php __('Invoice Number'); ?></th>
		<th><?php __('Moratorium Refinancing Plan Id'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($refinancingPlan['Installment'] as $installment):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $installment['installment_id'];?></td>
			<td><?php echo $installment['refinancing_plan_id'];?></td>
			<td><?php echo $installment['installment_number'];?></td>
			<td><?php echo $installment['amount'];?></td>
			<td><?php echo $installment['second_due_amount'];?></td>
			<td><?php echo $installment['interest'];?></td>
			<td><?php echo $installment['previous_debt'];?></td>
			<td><?php echo $installment['payment_date'];?></td>
			<td><?php echo $installment['payment_amount'];?></td>
			<td><?php echo $installment['invoice_number'];?></td>
			<td><?php echo $installment['moratorium_refinancing_plan_id'];?></td>
			<td><?php echo $installment['created'];?></td>
			<td><?php echo $installment['created_by'];?></td>
			<td><?php echo $installment['updated'];?></td>
			<td><?php echo $installment['updated_by'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'installments', 'action' => 'view', $installment['installment_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'installments', 'action' => 'edit', $installment['installment_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'installments', 'action' => 'delete', $installment['installment_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $installment['installment_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Installment', true), array('controller' => 'installments', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
	<h3><?php __('Related Installments');?></h3>
	<?php if (!empty($refinancingPlan['InstallmentMoratorium'])):?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('Installment Id'); ?></th>
		<th><?php __('Refinancing Plan Id'); ?></th>
		<th><?php __('Installment Number'); ?></th>
		<th><?php __('Amount'); ?></th>
		<th><?php __('Second Due Amount'); ?></th>
		<th><?php __('Interest'); ?></th>
		<th><?php __('Previous Debt'); ?></th>
		<th><?php __('Payment Date'); ?></th>
		<th><?php __('Payment Amount'); ?></th>
		<th><?php __('Invoice Number'); ?></th>
		<th><?php __('Moratorium Refinancing Plan Id'); ?></th>
		<th><?php __('Created'); ?></th>
		<th><?php __('Created By'); ?></th>
		<th><?php __('Updated'); ?></th>
		<th><?php __('Updated By'); ?></th>
		<th class="actions"><?php __('Actions');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($refinancingPlan['InstallmentMoratorium'] as $installmentMoratorium):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $installmentMoratorium['installment_id'];?></td>
			<td><?php echo $installmentMoratorium['refinancing_plan_id'];?></td>
			<td><?php echo $installmentMoratorium['installment_number'];?></td>
			<td><?php echo $installmentMoratorium['amount'];?></td>
			<td><?php echo $installmentMoratorium['second_due_amount'];?></td>
			<td><?php echo $installmentMoratorium['interest'];?></td>
			<td><?php echo $installmentMoratorium['previous_debt'];?></td>
			<td><?php echo $installmentMoratorium['payment_date'];?></td>
			<td><?php echo $installmentMoratorium['payment_amount'];?></td>
			<td><?php echo $installmentMoratorium['invoice_number'];?></td>
			<td><?php echo $installmentMoratorium['moratorium_refinancing_plan_id'];?></td>
			<td><?php echo $installmentMoratorium['created'];?></td>
			<td><?php echo $installmentMoratorium['created_by'];?></td>
			<td><?php echo $installmentMoratorium['updated'];?></td>
			<td><?php echo $installmentMoratorium['updated_by'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('View', true), array('controller' => 'installments', 'action' => 'view', $installmentMoratorium['installment_id'])); ?>
				<?php echo $this->Html->link(__('Edit', true), array('controller' => 'installments', 'action' => 'edit', $installmentMoratorium['installment_id'])); ?>
				<?php echo $this->Html->link(__('Delete', true), array('controller' => 'installments', 'action' => 'delete', $installmentMoratorium['installment_id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $installmentMoratorium['installment_id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('New Installment Moratorium', true), array('controller' => 'installments', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
